package com.szgr.baoyin.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;

import com.szgr.baoyin.R;

/**
 * Created by Jimbo on 2015/9/18.
 */
public class OrderListAdapter extends BaseAdapter {
    private Context mContext;
    public OrderListAdapter(Context context){
        mContext = context;
    }
    @Override
    public int getCount() {
        return 7;
    }

    @Override
    public Object getItem(int position) {
        return null;
    }

    @Override
    public long getItemId(int position) {
        return 0;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        ViewHolder holder = null;
        if(convertView == null){
            convertView = LayoutInflater.from(mContext).inflate(R.layout.item_order_list_view,parent,false);
            holder = new ViewHolder(convertView);
            convertView.setTag(holder);
        }
        holder = (ViewHolder) convertView.getTag();

        return convertView;
    }

    private class ViewHolder {
        ImageView img_head;
        TextView tv_name;
        TextView tv_job;
        TextView tv_count;
        TextView tv_state;

        public ViewHolder(View view){
            img_head = (ImageView) view.findViewById(R.id.order_head);
            tv_name = (TextView) view.findViewById(R.id.order_name);
            tv_job = (TextView) view.findViewById(R.id.order_job);
            tv_count = (TextView) view.findViewById(R.id.order_count);
            tv_state = (TextView) view.findViewById(R.id.order_state);
        }
    }
}
